#define  _CRT_SECURE_NO_WARNINGS 1
#include<assert.h>
#include<stdio.h>
char* my_strncpy(char* dest, const char* src,size_t num)
{
	assert(dest && src);
	size_t n = num-1;
	char* str = dest;
	while ((*dest++ = *src++) &&n--)
	{
		;
	}
	return str;
}

int main()
{
	char arr1[] = "abcdef";
	char arr2[200] = "xxxxxxxxx";
	char* str = my_strncpy(arr2, arr1,5 );
	printf("%s", str);
	return 0;
}